import 'package:flutter/material.dart';
import 'package:github_client_app/blocs/bloc_exports.dart';
import 'package:github_client_app/screens/tasks_screen.dart';
import 'package:path_provider/path_provider.dart';

main(List<String> args) async {
  WidgetsFlutterBinding.ensureInitialized();
  // bloc本地缓存
  HydratedBloc.storage = await HydratedStorage.build(
    storageDirectory: await getApplicationDocumentsDirectory(),
  );
  runApp(const MyAPP());
}

class MyAPP extends StatelessWidget {
  const MyAPP({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (context) => TasksBloc(),
      child: MaterialApp(
        title: "task app",
        theme: ThemeData(primarySwatch: Colors.amber),
        home: const TasksScreen(),
      ),
    );
  }
}
